package sge.servlets;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import sge.beans.Fachada;
import sge.beans.AreaProfissional;

public class AreaProfissionalServlet extends HttpServlet {
	
	private static final long serialVersionUID = 1L;
	
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
			
		String nomeArea = req.getParameter("area");
		
		AreaProfissional area = new AreaProfissional();
		area.setNome(nomeArea);
		Fachada fachada = Fachada.obterInstancia();
		fachada.cadastrarAreaProfissional(area);
		
		RequestDispatcher dispatcher = req.getRequestDispatcher("/feedback/cadastro_efetuado.jsp");
		dispatcher.forward(req, resp);
		
	}

}
